#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    newButton = new QPushButton("new", this);
    newButton->move(390, 270);
    QObject::connect(newButton, SIGNAL(clicked()), this, SLOT(do_newButton_click()));
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_changeButton_clicked()
{

    ui->label->setText("goodbye world");
}

void MainWindow::do_newButton_click(){
    if(ui->label->text() == "Hello"){
        ui->label->setText("world");
    }else{
        ui->label->setText("Hello");
    }
}
